import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { ListComponent } from './list/list.component';
import { ListdetailComponent } from './listdetail/listdetail.component';
import { Editor } from './listedit/listedit.component';
import { CollectionComponent } from './collection/collection.component';

//配置路由
const routes: Routes = [{
  path:"",
  component:ListComponent
},
  {
    path:"list",
    component:ListComponent
  },
  {
    path:"list/:id",
    component:ListdetailComponent
  },
  {
    path:"edit",
    component:Editor
  },
  {
    path:"edit/:id",
    component:Editor
  },
  {
    path:"collection",
    component:CollectionComponent
  },
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
